﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema
	xmlns="http://schemas.microsoft.com/Search/2008/suggestions"
	xmlns:xs="http://www.w3.org/2001/XMLSchema"
	targetNamespace="http://schemas.microsoft.com/Search/2008/suggestions"
	attributeFormDefault="unqualified" elementFormDefault="qualified">
	<xs:annotation>
		<xs:documentation>
			<![CDATA[
			
				Based on the decidedly average spec at:
				http://msdn.microsoft.com/en-us/library/cc848863(VS.85).aspx
				
				Hosted at:
				http://tath.am/tools/open-search-validator
				
				This is my interpretation of the above document, combined with my experience
				with suggestion XML that should technically work, but actually doesn't.
				
				This is NOT provided by or endorsed by Microsoft and may or may not be accurate.
				
				It's just a guide people...
			
			]]>
		</xs:documentation>
	</xs:annotation>
	<xs:element name="SearchSuggestion">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="Query" type="xs:string" minOccurs="1" maxOccurs="1" />
				<xs:element name="Section" maxOccurs="1">
					<xs:complexType>
						<xs:sequence>
							<xs:choice maxOccurs="unbounded">
								<xs:element name="Separator" maxOccurs="unbounded">
									<xs:complexType>
										<xs:attribute name="title" use="optional">
											<xs:simpleType>
												<xs:restriction base="xs:string">
													<xs:maxLength value="50" />
												</xs:restriction>
											</xs:simpleType>
										</xs:attribute>
									</xs:complexType>
								</xs:element>
								<xs:element name="Item" maxOccurs="unbounded">
									<xs:complexType>
										<xs:all>
											<xs:element name="Text" minOccurs="0" maxOccurs="1">
												<xs:simpleType>
													<xs:restriction base="xs:string">
														<xs:maxLength value="50" />
													</xs:restriction>
												</xs:simpleType>
											</xs:element>
											<xs:element name="Url" type="xs:anyURI" minOccurs="0" maxOccurs="1" />
											<xs:element name="Description" minOccurs="0" maxOccurs="1">
												<xs:simpleType>
													<xs:restriction base="xs:string">
														<xs:maxLength value="300" />
													</xs:restriction>
												</xs:simpleType>
											</xs:element>
											<xs:element name="Image" minOccurs="0" maxOccurs="1">
												<xs:complexType>
													<xs:attribute name="width" use="required">
														<xs:simpleType>
															<xs:restriction base="xs:unsignedShort">
																<xs:minExclusive value="0" />
																<xs:maxInclusive value="75" />
															</xs:restriction>
														</xs:simpleType>
													</xs:attribute>
													<xs:attribute name="height" use="required">
														<xs:simpleType>
															<xs:restriction base="xs:unsignedShort">
																<xs:minExclusive value="0" />
																<xs:maxInclusive value="75" />
															</xs:restriction>
														</xs:simpleType>
													</xs:attribute>
													<xs:attribute name="alt" type="xs:string" use="optional" />
													<xs:attribute name="align" use="optional">
														<xs:simpleType>
															<xs:restriction base="xs:string">
																<xs:enumeration value="top" />
																<xs:enumeration value="middle" />
																<xs:enumeration value="bottom" />
															</xs:restriction>
														</xs:simpleType>
													</xs:attribute>
													<xs:attribute name="source" type="xs:anyURI" use="required" />
												</xs:complexType>
											</xs:element>
										</xs:all>
									</xs:complexType>
								</xs:element>
							</xs:choice>
						</xs:sequence>
						<xs:anyAttribute namespace="##any" processContents="lax" />
					</xs:complexType>
				</xs:element>
			</xs:sequence>
			<xs:anyAttribute namespace="##any" processContents="lax" />
		</xs:complexType>
	</xs:element>
</xs:schema>